package com.atguigu.gulimall.auth;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
/**
 * spring-session核心原理
 * 1、@EnableRedisHttpSession导入了 RedisHttpSessionConfiguration配置
 *    SessionRepository==>RedisOperationsSessionRepository==>redis操作session  session的增删改查封装类
 *  2、SessionRepositoryFilter==》Filter ：session存储的过滤器  每个请求过来都必须经过filter
 *     1、创建的时候，就自动从容器中获取到了SessionRepository
 *     2、原始的request,response都被包装 SessionRepositoryRequestWrapper,SessionRepositoryResponseWrapper
 *     3、以后获取session request.getSession()
 *     SessionRepositoryRequestWrapper  SessionRepositoryResponseWrapper
 *     4、wrappedRequest.getSession()；===>sessionRepository中获取到
 *  装饰者模式：
 *
 * 也支持自动延期功能（做了相关操作）  redis中是的数据也是有过期时间
 *
 *
 */
@EnableRedisHttpSession  //整合redis作为session的存储
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class GulimallAuthServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallAuthServerApplication.class, args);
    }

}
